package com.laojiang.mapper;

import com.laojiang.pojo.ClassTime;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ClassTimeMapper {
    // 添加课程时间信息
    public int InsertClassTime(ClassTime classTime);

    // 查询课程时间
    public List<ClassTime> classTimes(@Param("course_cno") String course_cno, @Param("class_weekend") int class_weekend,
                                      @Param("class_time") int class_time);

    // 修改课程时间
    @Update("UPDATE classtime set class_weekend=#{class_weekend},class_time=#{class_time}\n" +
            "        where course_cno=#{course_cno}")
    public int UpdateClassTime(ClassTime classTime);

    // 删除课程时间
    @Delete("DELETE from classtime where 1=1  and course_cno=#{course_cno}")
    public int DelClassTime(@Param("course_cno") String course_cno);
}
